﻿using UnityEngine;
using System.Collections;

public class HitZoneScript : MonoBehaviour 
{
	ShayneMovementScript MovementScript;
	ShaneAttackScript AttackScript;

	void Start()
	{
		MovementScript = GetComponentInParent<ShayneMovementScript> ();
		AttackScript = GetComponentInParent<ShaneAttackScript> ();
	}



	public void OnTriggerEnter(Collider c)
	{
		Hittable h = c.GetComponent (typeof(Hittable)) as Hittable;
		if (h != null) 
		{
			if(MovementScript.currentMoveSpeed == MovementScript.StockMoveSpeed)
				h.Hit(AttackScript.ramForceRegular);
			else
				h.Hit (AttackScript.ramForceThrusting);
		}
	}
}
